# Contributor: Petr Hodina <phodina@protonmail.com>
# Maintainer: Petr Hodina <phodina@protonmail.com>
pkgname=dovi-tool
pkgver=2.1.2
pkgrel=0
pkgdesc="Library to read and write Dolby Vision metadata"
url="https://github.com/quietvoid/dovi_tool"
# arm: fails tests
arch="all !armhf !armv7"
license="MIT"
makedepends="cargo cargo-auditable fontconfig-dev"
checkdepends="font-opensans"
source="$pkgname-$pkgver.tar.gz::https://github.com/quietvoid/dovi_tool/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/dovi_tool-$pkgver"
options="net" # cargo fetch

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen --release
}

package() {
	install -Dm755 target/release/dovi_tool -t "$pkgdir"/usr/bin/
}

sha512sums="
894ce361f6f6cc1dfdad51a4f1751a0454e0fbfa8e00783f8cdd5fac22a4cb131dfdc4550b6b8649185bddd94347167304ddda67c68a99d9030410f4afc556b1  dovi-tool-2.1.2.tar.gz
"
